package com.liam.lotterysystem.common.filter;

import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.spi.FilterReply;
import ch.qos.logback.core.filter.Filter;

/**
 * @Author: LiamLMK
 * @CreateTime: 2024-10-10
 * @Description: 过滤INFO级别日志并返回
 * @Version: 1.0
 */

public class InfoLevelFilter extends Filter<ILoggingEvent> {

    @Override
    public FilterReply decide(ILoggingEvent iLoggingEvent) {
        if (iLoggingEvent.getLevel().toInt() == Level.INFO.toInt()) {
            return FilterReply.ACCEPT;
        }
        return FilterReply.DENY;
    }
}